<% title header ||= "" %>
<span class="pull-right"><%= (_("<b class='select_count'>0</b> of <b>%s</b> selected") % @hosts.total_entries).html_safe %></span>
<table class="<%= table_css_classes 'table-fixed' %>">
  <thead>
    <tr>
      <th class="ca" width="40px"><%= check_box_tag "check_all", "", false, { :onchange => "tfm.hosts.table.toggleCheck()", :'check-title' => _("Select all items on this page"), :'uncheck-title'=> _("items selected. Uncheck to Clear") } %></th>
      <%= render_pagelets_for(:hosts_table_column_header) %>
      <th hidden="true" width="25%"><%= sort :name, :as => _('Name') %></th>
      <th hidden="true" class="hidden-xs" width="17%"><%= sort :os_title, :as => _("Operating system") %></th>
      <th hidden="true" class="hidden-tablet hidden-xs" width="10%"><%= sort :model, :as => _('Model') %></th>
      <th hidden="true" class="hidden-tablet hidden-xs" width="8%"><%= sort :owner, :as => _('Owner') %></th>
      <th hidden="true" class="hidden-tablet hidden-xs" width="15%"><%= sort :hostgroup, :as => _("Host group") %></th>
      <th hidden="true" class="hidden-tablet hidden-xs" width="10%"><%= sort :last_report, :as => _('Last report'), :default => 'DESC' %></th>
      <th hidden="true" class="hidden-tablet hidden-xs" width="7%"><%= sort :comment, :as => _('Comment') %></th>
      <th width="100px"><%= _('Actions') %></th>
    </tr>
  </thead>
  <tbody>
    <% hosts.each do |host| %>
      <tr>
        <td class="ca">
          <%= check_box_tag "host_ids[]", nil, false, :id => "host_ids_#{host.id}", :class => 'host_select_boxes', :onclick => 'tfm.hosts.table.hostChecked(this)' %>
        </td>
        <%= render_pagelets_for(:hosts_table_column_content, :subject => host) %>
        <td hidden="true" class="ellipsis"><%= name_column(host) %></td>
        <td hidden="true" class="hidden-xs ellipsis"><%= (icon(host.operatingsystem, :size => "16x16") + " #{host.operatingsystem.to_label}").html_safe if host.operatingsystem %></td>
        <td hidden="true" class="hidden-tablet hidden-xs ellipsis"><%= host.compute_resource_or_model %></td>
        <td hidden="true" class="hidden-tablet hidden-xs ellipsis"><%= host_owner_column(host) %></td>
        <td hidden="true" class="hidden-tablet hidden-xs"><%= label_with_link host.hostgroup, 23, @hostgroup_authorizer %></td>
        <td hidden="true" class="hidden-tablet hidden-xs ellipsis"><%= last_report_column(host) %></td>
        <td hidden="true" class="hidden-tablet hidden-xs ca" title="<%= h host.comment&.truncate(255) %>"><%= icon_text('comment', '') unless host.comment.empty? %></td>
	<td>
          <%= action_buttons(
                      display_link_if_authorized(_("Edit"), hash_for_edit_host_path(:id => host).merge(:auth_object => host, :authorizer => authorizer)),
                      display_link_if_authorized(_("Clone"), hash_for_clone_host_path(:id => host)),
                      display_delete_if_authorized(hash_for_host_path(:id => host).merge(:auth_object => host, :authorizer => authorizer), :data => { :confirm => delete_host_dialog(host) }, :action => :destroy))%>
        </td>
      </tr>
    <% end %>
  </tbody>
</table>
<div id="confirmation-modal" class="modal fade">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        <h4 class="modal-title"><%= _('Please Confirm') %></h4>
      </div>
      <div class="modal-body">
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal"><%= _('Cancel') %></button>
        <button type="button" class="btn btn-primary" onclick='tfm.hosts.table.submitModalForm()'><%= _('Submit') %></button>
      </div>
    </div><!-- /.modal-content -->
  </div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<%= will_paginate_with_info hosts %>
